package com.dsj.gxrd.modules.controller.activity;

import com.dsj.gxrd.modules.activity.domain.vo.GroupUserVo;
import com.dsj.gxrd.modules.activity.domain.vo.RdGroupVo;
import com.dsj.gxrd.modules.activity.service.RdGroupService;
import com.ruoyi.common.core.web.controller.BaseController;
import com.ruoyi.common.core.web.page.TableDataInfo;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;


/**
 * ok
 * @author songpin566
 * @date 2023/09/14
 **/
@Api(tags = "分组分类")
@RestController
@RequestMapping("/group")
public class RdGroupController extends BaseController {

    @Autowired
    private RdGroupService rdGroupService;

    @GetMapping("/list")
    public TableDataInfo list(@RequestParam(value = "name", required = false) String name,
                              @RequestParam(value = "groupName", required = false) String groupName) {
        startPage();
        List<RdGroupVo> list = rdGroupService.selectRdGroupList(name, groupName);
        return getDataTable(list);
    }

    @GetMapping("/{groupId}")
    public TableDataInfo getInfo(@PathVariable Long groupId,@RequestParam(value = "name",required = false)String name) {
        startPage();
        List<GroupUserVo> groupUserVoList = rdGroupService.getInfo(groupId,name);
        return getDataTable(groupUserVoList);
    }


}
